home *** CD-ROM | disk | FTP | other *** search
- Path: rex.sfe.com.au!not-for-mail
- From: paul@sfe.com.au (Paul Hatchman)
- Newsgroups: comp.windows.x.motif,comp.lang.c++
- Subject: Re: MOTIF Callbacks, C++ Member Functions - SOLVED
- Date: 20 Feb 1996 14:25:57 +1100
- Organization: Sydney Futures Exchange, Sydney, Australia
- Distribution: inet
- Message-ID: <4gbf05$6d8@rex.sfe.com.au>
- References: <4f6oau$c4m@knot.queensu.ca> <4f9fbo$7ju@news1.halcyon.com>
- NNTP-Posting-Host: rex.sfe.com.au
-
- danubius@chinook.halcyon.com () writes:
-
- >Wintermute <3mal5@qlink.queensu.ca> wrote:
- >>
- >>The solution was to declare a static member function which is used as a
- >>callback. Since it is static, there is no 'this' pointer, and it works
- >>fine. To access the particular class instance, pass the 'this' pointer
- >>as client data when installing the callback, and it will be available
- >>when the static member function is called back.
-
- >Which is exactly the method Doug Young uses in his book on Motif with
- >C++.
-
- >Joe
-
- I dont think there are any guarantees that a compiler will give static
- functions "C" style linkage. It works with every compiler I have tried, but I
- dont believe it is guaranteed to be portable.
-
- Can someone give an authorative answer on this?
-
- - Paul
-
- --------------------------------------------------------------------------------
- Paul Hatchman, | <this line intentionally left blank>
- Project Leader, | paul@sfe.com.au
- Sydney Futures Exchange, Australia | Tel: +61 2 2560567
- --------------------------------------------------------------------------------
-